/*

WARNING: DO NOT USE WITH MORE THAN THE FOLLOWING PARTS:
	MSP430G2452
	32768 CRYSTAL
	3.3V Regulator***

*** Do not use the 3.3V regulator AND the programming Vcc simultaneoulsy.
There is no protection for this.

This is designed to test the 32.768Khz crystal. It will generate a signal
at approximately 64Hz on all of P1 outputs.

*/
#include <msp430.h>

unsigned int counter = 0;

int main()
{
	WDTCTL = WDTPW + WDTHOLD;

	P2DIR = 0x3F;
	P2OUT = 0x01;


	TACTL = TASSEL_1 | MC_1;
	TACCTL0 = CCIE;
	CCR0 = 0xFFFF; //1hz, toggling doubles this duration.

	__bis_SR_register(CPUOFF + GIE);
	return 0;
}

/*CCR0 Interrupt*/
#ifdef __GNUC__
__attribute__((interrupt(TIMER0_A0_VECTOR)))
#else
#pragma vector = TIMER0_AO_VECTOR
	__interrupt
#endif
void TIMER0_A0_ISR(void)
{
	if(P2OUT == 0x00)
		P2OUT = 0x01;
	P2OUT <<= 1;
	P2OUT &= 0x3F;
}
